<?php

namespace app\validate;

use app\Validate;

class AdminRolesValidate extends Validate
{
    protected $rule =   [
        'name'  => ["require", "min:2"],
        'pid'   => ["number", "notIn:1"],
        "rules" => ["require"],
    ];

    protected $message  =   [
        'name.require' => '角色必须',
        'name.min' => '角色名太短',
        'pid.number' => '非法参数',
        'pid.notIn' => '非法参数',
        'rules.require' => '权限必须',
    ];

    protected $scene = [
        'add'  =>  ['name', 'pid', 'rules'],
        'edit'  =>  ['name', 'pid', 'rules'],
    ];
}
